
/*让左侧导航高亮*/
	function highlight_subnav(url) {
	    var obj = $('#accordion').find('a[href="' + url + '"]');
	    var li  = obj.parentsUntil();
	    	li.addClass('active');
	    	li.parentsUntil().css({'display':'block'});
	    	li.parentsUntil().parentsUntil().addClass('open');
	}

	function submits () {
		$('.submits').submit();
	}


$(function() {
	var Accordion = function(el, multiple) {
		this.el = el || {};
		this.multiple = multiple || false;

		// Variables privadas
		var links = this.el.find('.link');
		// Evento
		links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
	}

	Accordion.prototype.dropdown = function(e) {
		var $el = e.data.el;
			$this = $(this),
			$next = $this.next();

		$next.slideToggle();
		$this.parent().toggleClass('open');

		if (!e.data.multiple) {
			$el.find('.submenu').not($next).slideUp().parent().removeClass('open');
		};
	}	

	var accordion = new Accordion($('#accordion'), false);


// 全选、全不选
    $('.select-on-check-all').click(function(){
    	var checkboxes = $('tbody input:checkbox');
    	var len        = checkboxes.length;
    	isSelect = $(this)[0].checked;
	    for(var i=0;i<len;i++){
	      checkboxes[i].checked = isSelect;
	    }
    });




});